package cn.wolfcode.trip.app.controller;

import cn.wolfcode.trip.base.service.ISceneCommendService;
import cn.wolfcode.trip.base.service.ISceneIntroduceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

// 门票的控制器
@RestController
@RequestMapping("/commends")
public class SceneCommendController {

    @Autowired
    private ISceneCommendService sceneCommendService;

    @Autowired
    private ISceneIntroduceService introduceService;

    /*
    查询所有的推荐景点
    资源:/sceneCommends
    动作:GET
    参数type=x
     */
    @GetMapping
    public Object listSceneCommends() {
        return sceneCommendService.listSceneCommend();
    }


    /*
    查询某个景点介绍
    资源:/commends/{commendId}/introduces
    动作:GET
    参数
     */
    @GetMapping("/{commendId}/introduction")
    public Object listSceneCommends(@PathVariable Long commendId) {
        return introduceService.listIntroductionByCommendId(commendId);
    }
}
